<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
      <link rel="stylesheet" href="./../helpwin.css">
      <title>MATLAB File Help: prtClassBagging</title>
   </head>
   <body>
      <!--Single-page help-->
      <table border="0" cellspacing="0" width="100%">
         <tr class="subheader">
            <td class="headertitle">MATLAB File Help: prtClassBagging</td>
            
            
         </tr>
      </table>
      <div class="title">prtClassBagging</div>
      <div class="helptext"><pre><!--helptext -->  <span class="helptopic">prtClassBagging</span>  Bagging (Bootstrap Aggregating) classifier
 
     CLASSIFIER = <span class="helptopic">prtClassBagging</span> returns a bagging classifier
 
     CLASSIFIER = <span class="helptopic">prtClassBagging</span>(PROPERTY1, VALUE1, ...) constructs a
     <span class="helptopic">prtClassBagging</span> object CLASSIFIER with properties as specified by
     PROPERTY/VALUE pairs.
 
     A <span class="helptopic">prtClassBagging</span> object inherits all properties from the abstract
     class prtClass. In addition is has the following properties:
 
     baseClassifier  - The base classifier to be used 
     nBags           - The number of bags to aggregate over
     nSamplesPerBag  - The number of bootstrap samples to use per bag.
            When nSamplesPerBag is an empty matrix (the default),
            the number of bootstrap samples is set to the number of
            observations in the training data set.
     bootstrapByClass - A logical describing whether to enforce an
            equal number of bootstrap samples from each class in the
            training data set. If bootstrapByClass is true,
            floor(nSamplesPerBag/nClasses) samples per class are used
            when training each classifier.  bootstrapByClass defaults
            to false.
  
     Bagging classifiers are meta-classifiers that attempt to develop
     more robust decision boundaries by aggregating outputs over
     multiple bootstrapped samples of the original data.  For more
     information on bagging classifiers, see:
 
     <a href="http://en.wikipedia.org/wiki/Bootstrap_aggregating">http://en.wikipedia.org/wiki/Bootstrap_aggregating</a>
 
     A <span class="helptopic">prtClassBagging</span>  object inherits the TRAIN, RUN, 
     CROSSVALIDATE and KFOLDS methods from prtAction. It also inherits 
     the PLOT method from prtClass.
 
     Example:
 
      TestDataSet = prtDataGenUnimodal;       % Create some test and
      TrainingDataSet = prtDataGenUniModal;   % training data
      classifier = <span class="helptopic">prtClassBagging</span>;           % Create a classifier
      classifier.baseClassifier = prtClassMap; % Set the classifier to
                                               % a prtClassMap
      classifier = classifier.train(TrainingDataSet);    % Train
      classified = run(classifier, TestDataSet);         % Test
      subplot(2,1,1);
      classifier.plot;
      subplot(2,1,2);
      [pf,pd] = prtScoreRoc(classified,TestDataSet);
      h = plot(pf,pd,'linewidth',3);
      title('ROC'); xlabel('Pf'); ylabel('Pd');</pre></div><!--after help --><!--seeAlso--><div class="footerlinktitle">See also</div><div class="footerlink"> <a href="./prtClass.html">prtClass</a>, <a href="./prtClassLogisticDiscriminant.html">prtClassLogisticDiscriminant</a>, <a href="./prtClassBagging.html">prtClassBagging</a>,
     <a href="./prtClassMap.html">prtClassMap</a>, <a href="./prtClassFld.html">prtClassFld</a>, <a href="./prtClassBinaryToMaryOneVsAll.html">prtClassBinaryToMaryOneVsAll</a>, <a href="./prtClassDlrt.html">prtClassDlrt</a>,
     <a href="./prtClassPlsda.html">prtClassPlsda</a>, <a href="./prtClassFld.html">prtClassFld</a>, <a href="./prtClassRvm.html">prtClassRvm</a>, <a href="./prtClassGlrt.html">prtClassGlrt</a>,  <a href="./prtClassSvm.html">prtClassSvm</a>,
     <a href="./prtClassTreeBaggingCap.html">prtClassTreeBaggingCap</a>, <a href="./prtClassKmsd.html">prtClassKmsd</a>, <a href="./prtClassKnn.html">prtClassKnn</a>
</div>
      <!--Class-->
      <div class="sectiontitle">Class Details</div>
      <table class="class-details">
         <tr>
            <td class="class-detail-label">Superclasses</td>
            <td><a href="./prtClass.html">prtClass</a></td>
         </tr>
         <tr>
            <td class="class-detail-label">Sealed</td>
            <td>false</td>
         </tr>
         <tr>
            <td class="class-detail-label">Construct on load</td>
            <td>false</td>
         </tr>
      </table>
      <!--Constructors-->
      <div class="sectiontitle"><a name="constructors"></a>Constructor Summary
      </div>
      <table class="summary-list">
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/prtClassBagging.html">prtClassBagging</a></td>
            <td class="m-help">Bagging (Bootstrap Aggregating) classifier&nbsp;</td>
         </tr>
      </table>
      <!--Properties-->
      <div class="sectiontitle"><a name="properties"></a>Property Summary
      </div>
      <table class="summary-list">
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/baseClassifier.html">baseClassifier</a></td>
            <td class="m-help">The classifier to be bagged&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/bootstrapByClass.html">bootstrapByClass</a></td>
            <td class="m-help">Whether to force an equal number of bootstrap samples per class&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/dataSet.html">dataSet</a></td>
            <td class="m-help">The training prtDataSet, only stored if verboseStorage is true. &nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/dataSetSummary.html">dataSetSummary</a></td>
            <td class="m-help">Structure that summarizes prtDataSet.&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/internalDecider.html">internalDecider</a></td>
            <td class="m-help">Optional prtDecider object for making decisions&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/isCrossValidateValid.html">isCrossValidateValid</a></td>
            <td class="m-help">True&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/isNativeMary.html">isNativeMary</a></td>
            <td class="m-help">False&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/isSupervised.html">isSupervised</a></td>
            <td class="m-help">True&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/isTrained.html">isTrained</a></td>
            <td class="m-help">Indicates if prtAction object has been trained.&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/nBags.html">nBags</a></td>
            <td class="m-help">The number of bags&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/nSamplesPerBag.html">nSamplesPerBag</a></td>
            <td class="m-help">The number of bootstrap samples to use in each bag&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/name.html">name</a></td>
            <td class="m-help">Required by prtAction&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/nameAbbreviation.html">nameAbbreviation</a></td>
            <td class="m-help">Bagging&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/showProgressBar.html">showProgressBar</a></td>
            <td class="m-help">&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/twoClassParadigm.html">twoClassParadigm</a></td>
            <td class="m-help">Whether the classifier retures one output (binary) or two outputs (m-ary) when there are only two unique class labels&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/userData.html">userData</a></td>
            <td class="m-help">User specified data&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="name"><a href="./prtClassBagging/verboseStorage.html">verboseStorage</a></td>
            <td class="m-help">Specifies whether or not to store the training prtDataset.&nbsp;</td>
         </tr>
      </table>
      <!--Methods-->
      <div class="sectiontitle"><a name="methods"></a>Method Summary
      </div>
      <table class="summary-list">
         <tr class="summary-item">
            <td class="attributes">
               &nbsp;
               
            </td>
            <td class="name"><a href="./prtClassBagging/crossValidate.html">crossValidate</a></td>
            <td class="m-help">Cross validate prtAction using prtDataSet and cross validation keys.&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="attributes">
               &nbsp;
               
            </td>
            <td class="name"><a href="./prtClassBagging/get.html">get</a></td>
            <td class="m-help">get the object properties&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="attributes">
               &nbsp;
               
            </td>
            <td class="name"><a href="./prtClassBagging/kfolds.html">kfolds</a></td>
            <td class="m-help">Perform K-folds cross-validation of prtAction&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="attributes">
               &nbsp;
               
            </td>
            <td class="name"><a href="./prtClassBagging/optimize.html">optimize</a></td>
            <td class="m-help">Optimize action parameter by exhaustive function maximization.&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="attributes">
               &nbsp;
               
            </td>
            <td class="name"><a href="./prtClassBagging/plot.html">plot</a></td>
            <td class="m-help">Plot the output confidence of a prtClass object&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="attributes">
               &nbsp;
               
            </td>
            <td class="name"><a href="./prtClassBagging/run.html">run</a></td>
            <td class="m-help">Run a prtAction object on a prtDataSet object.&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="attributes">
               &nbsp;
               
            </td>
            <td class="name"><a href="./prtClassBagging/set.html">set</a></td>
            <td class="m-help">set the object properties&nbsp;</td>
         </tr>
         <tr class="summary-item">
            <td class="attributes">
               &nbsp;
               
            </td>
            <td class="name"><a href="./prtClassBagging/train.html">train</a></td>
            <td class="m-help">Train a prtAction object using training a prtDataSet object.&nbsp;</td>
         </tr>
      </table>
   </body>
</html>